﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Home.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Site.ViewModels.ProjectDetailModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%=Html.Encode(Model.Project.Title) %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="http://maps.google.com/maps?file=api&amp;v=3&amp;sensor=true&amp;key=<%= Model.GoogleAPI %>" type="text/javascript"></script>

<div class="clear"></div>
<div class="breadcrumbs">
    <a href="/home">Trang chủ</a>
    <span></span>
    <a href="/project">Dự án</a>
    <%if (Model.Project.ProjectCategory != null)
      { %>
        <span></span><a href="/project/list/<%=Model.Project.ProjectCategory.ID %>"><%=Model.Project.ProjectCategory != null ? Html.Encode(Model.Project.ProjectCategory.Name) : string.Empty%></a>
        <span></span><%=Model.Project.Title.Length > 60 ? Html.Encode(Model.Project.Title.Substring(0, 60)) + "..." : Html.Encode(Model.Project.Title)%> 
    <%} %>
</div>
<div class="line"></div>  
<div class="project_item">
    <div class="project_item_top">        
        <div class="duan_top_l">       
            <h2><%= Model.Project.Title %></h2>
            <div>
                <a href="/project/details/<%=Model.Project.ID %>/<%=Html.ToUrlFriendly(Model.Project.Title)%>">
                    <% string imgPath = (Model.Project.ImagePath != null && Model.Project.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(Model.Project.ID, 331, 230, Model.Project.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                    <img src="<%=imgPath %>" title="<%=Model.Project.Title %>" alt="<%=Model.Project.Title %>" class="bor_img" width="331" height="230" style="overflow:hidden"/>
                </a>
            </div>
        </div>
        <div class="duan_top_r">
            <div class="project-basic-info-title">Thông tin cơ bản</div>
            <div class="gra"></div>
            <div class="duan_list_function">
                <ul>
                    <% if (Model.Project.ProjectCompanyMaps != null)
                       {
                           foreach (var item in Model.Project.ProjectCompanyMaps)
                           {
                    %>
                    <li>
                        <label>
                            <%= item.ProjectCompanyType.Name %>
                        </label>
                        <span>:&nbsp;
                        <%= item.Company == null ? "--" : Html.Encode(item.Company.Name)%></span>
                    </li>
                    <%}
                       }%>
                    <li>
                        <label>Loại BDS</label>:
                        <%=Html.Encode(Model.Project.ProjectCategory.Name) %></li>
                    <li>
                        <label>Vị trí</label><span>:&nbsp;<%= Model.Project.Address %></span>
                    </li>
                    <li>
                        <label>Quy mô</label><span>:&nbsp;<%= Model.Project.Scale %></span></li>
                    <li>
                        <label>Tổng mức đầu tư</label>
                        <span>:&nbsp;<%= Model.Project.Investment %>&nbsp;
                        <%= Model.Project.InvestmentUnit %></span>
                    </li>
                    <li>
                        <label>Trạng thái pháp lý</label><span>:&nbsp;<%= Model.Project.ProjectLegalStatus.Name %></span></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="clear mar_t">&nbsp;</div>
    <% Html.RenderPartial("~/Views/Project/Images.ascx", Model); %>
    <div class="bor_cor content mar_t" style="overflow:hidden;">
        <div class="heading_bar">
            <div class="heading_bar_tit">
                <a href="/project/details/<%=Model.Project.ID %>/<%=Html.ToUrlFriendly(Model.Project.Title)%>">Thông tin chi tiết</a>
            </div>    
        </div>
        <div class="heading_bar_line"></div>
        <div class="tt_pad ">
            <%= Model.Project.ProjectContent %>
        </div>
    </div>
    <div class="clear"></div>
    <div id="prj_detail">
        <div class="investor">
        <%var investor=Model.Project.ProjectCompanyMaps.Where(e => e.TypeID == SDT.Lib.Common.ProjectCompanyListType.Investors).ToList(); %>
        <%if (investor != null && investor.Count>0) { %>
          <h3>Chủ đầu tư            
            <span class="investName">:&nbsp;<%=Html.Encode(investor[0].Company.Name) %></span>            
          </h3>
          <div class="d11">
            <a href="/company/details/<%=investor[0].Company.ID %>/<%=Html.ToUrlFriendly(investor[0].Company.Name)%>">
                <% string imgCompanyPath = (investor[0].Company.ImagePath != null && investor[0].Company.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(investor[0].Company.ID, 110, 110, investor[0].Company.ImagePath, Model.CompanyImagePath, Model.CompanyImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                <img src="<%=imgCompanyPath %>" title="<%=investor[0].Company.Name %>" alt="<%=investor[0].Company.Name %>" class="bor_img" width="110" height="110" style="overflow:hidden"/>
            </a>
          </div>
          <div class="d12">
            <ul>
                <li>
                    <label>Địa chỉ:</label>
                    <%=Html.Encode(investor[0].Company.Address) %>
                </li>
                <li>
                    <label>ĐT:</label>
                    <%=Html.Encode(investor[0].Company.Phone) %> |
                    <label>
                        Fax:
                    </label>
                    <%=Html.Encode(investor[0].Company.Fax) %>
                </li>
                <li>
                    <label>Website:</label>
                    <%=Html.Encode(investor[0].Company.Website) %></li>
                <li>
                    <label>
                        Email:
                    </label>
                    <%=Html.Encode(investor[0].Company.Email) %>
                 </li>
            </ul>
          </div>
          <%} %>
          </div>
    </div>
</div>
<% Html.RenderAction("TagLasted", "Project", new { id = Model.Project.ID, title = "Tags" }); %>
<% Html.RenderAction("LatestComments", new { id = Model.Project.ID, number = 20 }); %>
<% Html.RenderAction("Comment", new { id = Model.Project.ID }); %>
<div class="clear"></div>
<% Html.RenderAction("ProductsInProject", "Project", new { id = Model.Project.ID, title = "Tin rao liên quan" }); %>
<div class="clear"></div>
<div class="clear"></div>
<% Html.RenderAction("ArticlesInProject", "Project", new { id = Model.Project.ID, number = 10, title = "Các bài viết liên quan" }); %>
<div class="clear"></div>
<% Html.RenderAction("OtherInCompany", "Project", new { id = Model.Project.ID, number = 10, title = "Các dự án cùng chủ đầu tư" }); %>
<div class="clear"></div>
<% Html.RenderAction("OtherItems", "Project", new { id = Model.Project.ID, number = 5, title = "Các dự án khác" }); %>
<div class="clear"></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContent" runat="server">
  <% Html.RenderAction("Search", "Project", new { id = Model.Project != null ? Model.Project.CatID : 0, cityid = Model.Project.City != null ? Model.Project.CityID : 0, distrid = Model.Project.District != null ? Model.Project.District.ID : 0, key = Model.Keyword }); %>
  <div class="clear mar_t"></div>
 <% Html.RenderAction("Lasted", "Video", new { catid = 0, number = 3, title = string.Empty }); %>
  <div class="clear mar_t"></div>
  <% Html.RenderAction("HotByCat", "Project", new {number=3, catid=0,hotYN= 1,pubYN= 1, title = "Dự án nổi bật" , prjorder="ID", prjorderDir="desc" }); %>
  <div class="clear"></div>
   <% Html.RenderAction("Focus", "Article", new { number = 5, skip = 0, catid =0, title = "Tin tiêu điểm", order = "ID", orderDir = "desc" }); %>
  <div class="clear"></div>
  <% Html.RenderAction("Lasted", "Event", new { number = 3, catid =0 }); %>
   <div class="clear"></div>
   <% Html.RenderAction("Lasted", "Useful", new { number = 8 }); %>
   <div class="clear"></div>
   <% Html.RenderAction("NewestByCat", "Article", new { number = 3, skip = 0, catid = SDT.Model.ConfigManager.GetChuyengiaPhantich(), title = "Chuyên gia phân tích", order = "ID", orderDir = "desc" }); %>
</asp:Content>
